package com.gis507.test.AISTest;


import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

/**
 * 1、继承Reducer类
 * 2、确定输入输出的类型
 * 3、重写reduce方法
 */
public class AisReducer extends Reducer<AisBean, LongWritable, LongWritable,AisBean> {

    @Override
    protected void reduce(AisBean key, Iterable<LongWritable> values, Context context) throws IOException, InterruptedException {
        for (LongWritable value : values) {

            context.write(value,key);

        }
    }
}
